package com.efa.backend.base.repository;

import java.util.Date;
import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.efa.backend.base.entity.HisProductProfit;
import com.efa.backend.base.entity.ProductDetail;

/**
 * @Description: TODO
 * @author zhaoxin
 * @date 2014年3月12日 下午7:54:40
 * @version V1.0
 */

@Repository
public interface HisProductProfitRepository extends
		JpaRepository<HisProductProfit, Long> {

	@Query(value="from HisProductProfit hpp where productDetail in ?1 and to_char(createDate,'YYYY-MM-DD') >= to_char(?2,'YYYY-MM-DD') and to_char(createDate,'YYYY-MM-DD') <= to_char(?3,'YYYY-MM-DD')")
	List<HisProductProfit> findDateBetweenList(List<ProductDetail> pdList,
			Date startDate, Date endDate);
}
